package com.ytsky.quotesystem.service.impl;

import com.ytsky.quotesystem.dao.InfoMapper;
import com.ytsky.quotesystem.dao.UserMapper;
import com.ytsky.quotesystem.entity.User;
import com.ytsky.quotesystem.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    /**
     *添加用户信息
     * @param user
     * @return
     */
    @Override
    public boolean append(User user) {
        return userMapper.insert(user) >0;
    }

    /**
     *更改用户信息
     * @param user
     * @return
     */
    @Override
    public boolean modify(User user) {
        return userMapper.updateByIds(user) >0;
    }

    /**
     * 删除用户信息
     * @param id
     * @return
     */
    @Override
    public boolean remove(int id) {
        return userMapper.remove(id)>0;
    }
}
